import { Stack } from "expo-router";

export default function RootLayout() {
  return (
    <Stack>
      <Stack.Screen
        name="Meeting"
        options={{
          headerShown: true,
          title: "病例分享",
          headerTitleAlign: "center",
        }}
      />
      <Stack.Screen
        name="activity"
        options={{
          headerShown: true,
          title: "热门活动",
          headerTitleAlign: "center",
        }}
      />
      <Stack.Screen
        name="Academic"
        options={{ headerShown: true, title: "肿瘤专家",headerTitleAlign:"center" }}
      />
      <Stack.Screen
        name="Oncologist"
        options={{ headerShown: true, title: "学术中心",headerTitleAlign:"center" }}
      />
      <Stack.Screen
        name="Excellentclass"
        options={{ headerShown: true, title: "精品课程", headerTitleAlign: "center" }}
      />
      <Stack.Screen
        name="TumorHospital"
        options={{ headerShown: true, title: "肿瘤会议", headerTitleAlign: "center" }}
      />
      <Stack.Screen
        name="ExcellentclassShow"
        options={({ route }) => ({
          headerShown: true,
          title: route.params?.name || "课程详情",
          headerTitleAlign: "center",
        })}
            
      />
      <Stack.Screen
        name="Preview"
        options={({ route }) => ({
          headerShown: true,
          title: route.params?.name || "会议详情",
        })}
      />
      <Stack.Screen
        name="DescCourse"
        options={({ route }) => ({
          headerShown: true,
          title: route.params?.title || "默认标题", // 动态获取参数
          headerTitleAlign: "center",
        })}
      />
      <Stack.Screen
        name="MeetingShow"
        options={({ route }) => ({
          headerShown: true,
          title: route.params?.name || "会议详情",
          headerTitleAlign: "center",
        })}
      />
      <Stack.Screen
        name="Answer"
        options={{
          headerShown: true,
          title: "病例答疑",
          headerTitleAlign: "center",
        }}
      />
      <Stack.Screen
        name="DescActivity"
        options={({ route }) => ({
          headerShown: true,
          title: route.params?.title || "默认标题", // 动态获取参数
          headerTitleAlign: "center",
        })}
      />
      <Stack.Screen
        name="DescAcademic"
        options={{
          headerShown: true,
          title: "肿瘤专家",
          headerTitleAlign: "center",
        }}
      />
      <Stack.Screen 
      name="Descist"
      options={({route})=>({
        headerShown: true,
        title: route.params?.title || "默认标题", // 动态获取参数
        headerTitleAlign: "center",
      })}
      />
    </Stack>
  );
}
